package com.lxq.test2112.main01;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        int n,N=0,sum=0;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int[] A = new int[n+2];
        N = sc.nextInt();
        A[0]=0;
        for (int i=0;i<n;i++){
            A[i+1]=sc.nextInt();
        }//o(n)
        A[n+1]=N;
        for (int i=1;i<n+2;i++){
            sum=sum+(i-1)*(A[i]-A[i-1]);
        }
        System.out.println(sum);

    }
}
